Skip to content

同步会员开通结果

所有会员卡新开卡,我们回调给商家,商家还需要再同步给我们才算开卡成功(但是导入不用)

请求参数类型描述
user_card_codestring会员卡code
jsonobject声明请求的JSON数据结构
brand_idstring品牌ID
openidstring用户标识
card_colorstring卡背景颜色
card_picture_urlstring卡背景图URL
phone_numberstring加密的手机号
levelstring等级
valid_date_informationobject会员卡有效期
typestring有效期类型
FIX_TIME_RANGE | FIX_TERM | PERMANENT 枚举值之一
available_begin_timestring有效期开始时间
available_end_timestring有效期结束时间
available_day_after_receiveinteger生效后N天内有效
user_informationobject用户开卡时填写的个人信息
common_field_listobject[]平台提供的通用开卡信息字段
namestring平台提供的通用开卡信息字段
USER_FORM_FLAG_SEX | USER_FORM_FLAG_NAME | USER_FORM_FLAG_BIRTHDAY | USER_FORM_FLAG_ADDRESS | USER_FORM_FLAG_EMAIL | USER_FORM_FLAG_CITY 枚举值之一
valuestring加密的用户开卡时填写的个人信息
custom_field_listobject[]商户自定义的开卡信息字段
namestring字段名称
user_chosen_valuesstring[]加密的用户选择的字段值列表
attachstring商家数据包
user_card_confirm_statestring会员开卡状态
CREATE_CARD_SUCCESS | CREATE_CARD_FAIL 枚举值之一
queryobject声明请求的查询参数
card_idstring会员卡模版ID
headersobject声明请求的头参数
Wechatpay-Serialstring微信支付公钥ID/平台证书序列号
php
$instance->v3->brand->partner->cardMember->userCards->_user_card_code_->confirm->postAsync([
  'user_card_code' => '478515832665',
  'json' => [
    'brand_id'                => '1004',
    'openid'                  => 'obLatjnx9gnqzS4myYGmLZ7LgLBA',
    'card_color'              => '#FFFF00',
    'card_picture_url'        => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'phone_number'            => 'vvysDQeEaH3I+wRh14St0abIkvQyFgh/fbWY==',
    'level'                   => '钻石会员',
    'valid_date_information'  => [
      'type'                        => 'FIX_TIME_RANGE',
      'available_begin_time'        => '2020-05-20T13:29:35.120+08:00',
      'available_end_time'          => '2030-05-20T13:29:35.120+08:00',
      'available_day_after_receive' => 200,
    ],
    'user_information'        => [
      'common_field_list' => [[
        'name'  => 'USER_FORM_FLAG_SEX',
        'value' => 'vvysDQeEaH3I+wRh14St0abIkvQyFgh/fbWY==',
      ],],
      'custom_field_list' => [[
        'name'               => '喜欢的运动',
        'user_chosen_values' => ['vvysDQeEaH3I+wRh14St0abIkvQyFgh/'],
      ],],
    ],
    'attach'                  => '自定义数据说明',
    'user_card_confirm_state' => 'CREATE_CARD_SUCCESS',
  ],
  'query' => [
    'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/brand/partner/card-member/user-cards/{user_card_code}/confirm')->postAsync([
  'user_card_code' => '478515832665',
  'json' => [
    'brand_id'                => '1004',
    'openid'                  => 'obLatjnx9gnqzS4myYGmLZ7LgLBA',
    'card_color'              => '#FFFF00',
    'card_picture_url'        => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'phone_number'            => 'vvysDQeEaH3I+wRh14St0abIkvQyFgh/fbWY==',
    'level'                   => '钻石会员',
    'valid_date_information'  => [
      'type'                        => 'FIX_TIME_RANGE',
      'available_begin_time'        => '2020-05-20T13:29:35.120+08:00',
      'available_end_time'          => '2030-05-20T13:29:35.120+08:00',
      'available_day_after_receive' => 200,
    ],
    'user_information'        => [
      'common_field_list' => [[
        'name'  => 'USER_FORM_FLAG_SEX',
        'value' => 'vvysDQeEaH3I+wRh14St0abIkvQyFgh/fbWY==',
      ],],
      'custom_field_list' => [[
        'name'               => '喜欢的运动',
        'user_chosen_values' => ['vvysDQeEaH3I+wRh14St0abIkvQyFgh/'],
      ],],
    ],
    'attach'                  => '自定义数据说明',
    'user_card_confirm_state' => 'CREATE_CARD_SUCCESS',
  ],
  'query' => [
    'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/brand/partner/card-member/user-cards/{user_card_code}/confirm']->postAsync([
  'user_card_code' => '478515832665',
  'json' => [
    'brand_id'                => '1004',
    'openid'                  => 'obLatjnx9gnqzS4myYGmLZ7LgLBA',
    'card_color'              => '#FFFF00',
    'card_picture_url'        => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'phone_number'            => 'vvysDQeEaH3I+wRh14St0abIkvQyFgh/fbWY==',
    'level'                   => '钻石会员',
    'valid_date_information'  => [
      'type'                        => 'FIX_TIME_RANGE',
      'available_begin_time'        => '2020-05-20T13:29:35.120+08:00',
      'available_end_time'          => '2030-05-20T13:29:35.120+08:00',
      'available_day_after_receive' => 200,
    ],
    'user_information'        => [
      'common_field_list' => [[
        'name'  => 'USER_FORM_FLAG_SEX',
        'value' => 'vvysDQeEaH3I+wRh14St0abIkvQyFgh/fbWY==',
      ],],
      'custom_field_list' => [[
        'name'               => '喜欢的运动',
        'user_chosen_values' => ['vvysDQeEaH3I+wRh14St0abIkvQyFgh/'],
      ],],
    ],
    'attach'                  => '自定义数据说明',
    'user_card_confirm_state' => 'CREATE_CARD_SUCCESS',
  ],
  'query' => [
    'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->brand->partner->cardMember->userCards->_user_card_code_->confirm->post([
  'user_card_code' => '478515832665',
  'json' => [
    'brand_id'                => '1004',
    'openid'                  => 'obLatjnx9gnqzS4myYGmLZ7LgLBA',
    'card_color'              => '#FFFF00',
    'card_picture_url'        => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'phone_number'            => 'vvysDQeEaH3I+wRh14St0abIkvQyFgh/fbWY==',
    'level'                   => '钻石会员',
    'valid_date_information'  => [
      'type'                        => 'FIX_TIME_RANGE',
      'available_begin_time'        => '2020-05-20T13:29:35.120+08:00',
      'available_end_time'          => '2030-05-20T13:29:35.120+08:00',
      'available_day_after_receive' => 200,
    ],
    'user_information'        => [
      'common_field_list' => [[
        'name'  => 'USER_FORM_FLAG_SEX',
        'value' => 'vvysDQeEaH3I+wRh14St0abIkvQyFgh/fbWY==',
      ],],
      'custom_field_list' => [[
        'name'               => '喜欢的运动',
        'user_chosen_values' => ['vvysDQeEaH3I+wRh14St0abIkvQyFgh/'],
      ],],
    ],
    'attach'                  => '自定义数据说明',
    'user_card_confirm_state' => 'CREATE_CARD_SUCCESS',
  ],
  'query' => [
    'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/brand/partner/card-member/user-cards/{user_card_code}/confirm')->post([
  'user_card_code' => '478515832665',
  'json' => [
    'brand_id'                => '1004',
    'openid'                  => 'obLatjnx9gnqzS4myYGmLZ7LgLBA',
    'card_color'              => '#FFFF00',
    'card_picture_url'        => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'phone_number'            => 'vvysDQeEaH3I+wRh14St0abIkvQyFgh/fbWY==',
    'level'                   => '钻石会员',
    'valid_date_information'  => [
      'type'                        => 'FIX_TIME_RANGE',
      'available_begin_time'        => '2020-05-20T13:29:35.120+08:00',
      'available_end_time'          => '2030-05-20T13:29:35.120+08:00',
      'available_day_after_receive' => 200,
    ],
    'user_information'        => [
      'common_field_list' => [[
        'name'  => 'USER_FORM_FLAG_SEX',
        'value' => 'vvysDQeEaH3I+wRh14St0abIkvQyFgh/fbWY==',
      ],],
      'custom_field_list' => [[
        'name'               => '喜欢的运动',
        'user_chosen_values' => ['vvysDQeEaH3I+wRh14St0abIkvQyFgh/'],
      ],],
    ],
    'attach'                  => '自定义数据说明',
    'user_card_confirm_state' => 'CREATE_CARD_SUCCESS',
  ],
  'query' => [
    'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/brand/partner/card-member/user-cards/{user_card_code}/confirm']->post([
  'user_card_code' => '478515832665',
  'json' => [
    'brand_id'                => '1004',
    'openid'                  => 'obLatjnx9gnqzS4myYGmLZ7LgLBA',
    'card_color'              => '#FFFF00',
    'card_picture_url'        => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'phone_number'            => 'vvysDQeEaH3I+wRh14St0abIkvQyFgh/fbWY==',
    'level'                   => '钻石会员',
    'valid_date_information'  => [
      'type'                        => 'FIX_TIME_RANGE',
      'available_begin_time'        => '2020-05-20T13:29:35.120+08:00',
      'available_end_time'          => '2030-05-20T13:29:35.120+08:00',
      'available_day_after_receive' => 200,
    ],
    'user_information'        => [
      'common_field_list' => [[
        'name'  => 'USER_FORM_FLAG_SEX',
        'value' => 'vvysDQeEaH3I+wRh14St0abIkvQyFgh/fbWY==',
      ],],
      'custom_field_list' => [[
        'name'               => '喜欢的运动',
        'user_chosen_values' => ['vvysDQeEaH3I+wRh14St0abIkvQyFgh/'],
      ],],
    ],
    'attach'                  => '自定义数据说明',
    'user_card_confirm_state' => 'CREATE_CARD_SUCCESS',
  ],
  'query' => [
    'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
user_card_codestring会员卡code
card_idstring会员卡模板ID
openidstring用户标识
card_colorstring卡背景颜色
card_picture_urlstring卡背景图URL
brand_idstring品牌ID
card_typestring会员卡类型
PURCHASE | NORMAL | BALANCE 枚举值之一
phone_numberstring加密的手机号
levelstring等级
valid_date_informationobject会员卡有效期
typestring有效期类型
FIX_TIME_RANGE | FIX_TERM | PERMANENT 枚举值之一
available_begin_timestring有效期开始时间
available_end_timestring有效期结束时间
available_day_after_receiveinteger生效后N天内有效
pickup_timestring领取时间
user_informationobject用户开卡时填写的个人信息
common_field_listobject[]平台提供的通用开卡信息字段
namestring平台提供的通用开卡信息字段
USER_FORM_FLAG_SEX | USER_FORM_FLAG_NAME | USER_FORM_FLAG_BIRTHDAY | USER_FORM_FLAG_ADDRESS | USER_FORM_FLAG_EMAIL | USER_FORM_FLAG_CITY 枚举值之一
valuestring加密的用户开卡时填写的个人信息
custom_field_listobject[]商户自定义的开卡信息字段
namestring字段名称
user_chosen_valuesstring[]加密的用户选择的字段值列表
attachstring商家数据包
user_card_statestring用户会员卡状态
UNACTIVATED | EFFECTIVE | EXPIRED | INVALID 枚举值之一
invalid_reasonstring作废原因
invalid_timestring作废时间

参阅 官方文档

Published on the GitHub by TheNorthMemory